#include<string.h>
//StudybarCommentBegin
#include <stdio.h>
#include <malloc.h>
char* encode(char * string);
char* decode(char * string);
void main()
{
	char mingwen[100];
	char miwen[100];
	gets(mingwen);	
	gets(miwen);

	char* jiami=encode(mingwen);
	printf("%s\n",jiami);
	char* jiemi=decode(miwen);
	printf("%s\n",jiemi);
}
//StudybarCommentEnd
char* encode(char * string)
{
	int i,j=0,k;
	char a[100];
	for(i=0;string[i]!='\0';i++)
	{
		if(string[i]>='a'&&string[i]<='i')
		{
			a[j]=string[i]-'a'+'1';
			j++;
		}
		else if(string[i]>='j'&&string[i]<='r')
		{
			a[j]='0';a[j+1]=string[i]-'j'+'1';
			j+=2;
		}
		else if(string[i]>='s'&&string[i]<='z')
		{
			a[j]='0';a[j+1]='0';a[j+2]=string[i]-'s'+'1';
			j+=3;
		}
		else 
		{
			a[j]=string[i];
			j++;
		}	
	}
	a[j]='\0';
	for(k=0;a[k]!='\0';k++)
	{
		string[k]=a[k];
	}
	string[k]='\0';
	return string;
}
char* decode(char * string)
{
	int i,j=0,k;
	int a[100];
	for(i=0;string[i]!='\0';)
	{
		if(string[i]>='1'&&string[i]<='9')
		{
			a[j]=string[i]+'a'-'1';
			j++;i++;
		}
		else if(string[i]=='0'&&string[i+1]>='1'&&string[i+1]<='9')
		{
			a[j]=string[i+1]+'j'-'1';
			j++;i+=2;
		}
		else if(string[i]=='0'&&string[i+1]=='0'&&string[i+2]>='1'&&string[i+2]<='9')
		{
			a[j]=string[i+2]+'s'-'1';
			j++;i+=3;
		}
		else 
		{
			a[j]=string[i];
			j++;i++;
		}	
	}
	a[j]='\0';
	for(k=0;a[k]!='\0';k++)
	{
		string[k]=a[k];
	}
	string[k]='\0';
	return string;
}